<template>
    <div class="layerRtb layerRtb-threecolumn">
        <three-title :title="{name:'个人资料'}"></three-title>
        <div class="layerRtb-scroll thinScroll" v-scrollHeight="437">
            <div class="analyItem">
                <p class="analyItemTit tx-center" :class="(this.stageInfo.age === undefined || this.stageInfo.age === null || this.stageInfo.age === '') ||
                (this.stageInfo.is_marry === undefined || this.stageInfo.is_marry === null || this.stageInfo.is_marry === '') ? '' : 'analyLightGreen'">基本资料</p>
                <div class="analyItemCon"  v-if="flg==1">
                    <p class="col-md-4">年龄： <span class="cLightGray pr8">{{ this.stageInfo.age }}</span> </p>
                    <p class="col-md-4">婚否： <span class="cLightGray pr8">{{ Number(this.stageInfo.is_marry) === 0 ? '已婚' : '未婚' }}</span> </p>
                    <div class="imgbox imgbox1 col-md-3"  style="margin-top: 15px;">
                        <img src="https://gnr.rxjy.com/hrms/static/modules/cur/images/edit_img.png" title="编辑" width="20" class="fr pointer mr5" @click="flg=0">
                    </div>
                </div>
                <div class="analyItemCon" v-else>
                    <div class="textBoxtxt hide" style="display: block;">
                        <p class="col-md-4">
                            <span class="cLightGray pr8">年龄</span>
                            <input type="text" class="width120 evaluateStandard" name="set_stage_info_age" v-model="age">
                        </p>
                        <p class="col-md-4">
                            <span class="cLightGray pr8">婚否</span>
                            <!--<input type="text" class="width120 evaluateStandard" name="set_userInfo_sex" value="">-->
                            <select name="set_stage_info_is_marry" class="width80" v-model="is_marry">
                                <option value="0">已婚</option>
                                <option value="1">未婚</option>
                            </select>
                        </p>
                    </div>
                        <div class="imgbox imgbox2 " style="margin-top: 15px;">
                            <img src="https://gnr.rxjy.com/hrms/static/modules/cur/images/save_img.png" title="保存" width="20" class="fl pointer mr5" name="update_stage_info_intention" @click="updateStageInfo1()">
                            <img src="https://gnr.rxjy.com/hrms/static/modules/cur/images/goback_img.png" title="返回" width="20" class="fl pointer mr5" @click="flg=1">
                        </div>
                </div>
            </div>
                <!-- 身份证的信息 -->
            <div class="analyItem">
                    <!-- <p class="analyItemTit tx-center" :class="((this.idCardStr === undefined || this.idCardStr === null || this.idCardStr === '') ||
                    (photoList[9] === null || photoList[9] ==='' || photoList[9] === undefined) ||
                    (photoList[8] === null || photoList[8] ==='' || photoList[8] === undefined)) ? '' : 'analyLightGreen'">身份证</p>
                     -->
                     <p class="analyItemTit tx-center" :class="((this.idCardStr === undefined || this.idCardStr === null || this.idCardStr === '') ||
                    JSON.stringify(this.photo4) === '{}' ||
                    JSON.stringify(this.photo8) === '{}') ? '' : 'analyLightGreen'">身份证</p>
                    <div class="analyItemCon"  v-if="flg1==1">
                        <p class="col-md-12">
                            <span class="cLightGray pr8">身份证号</span>
                            <span name="idCardName">{{ idCardStr }}</span>
                        </p>
                        <p class="col-md-6">
                        <!-- 正面 -->
                        <!-- (this.photo9.url === null || this.photo9.url ==='' || this.photo9.url === undefined) ||  -->
                            <span v-if="JSON.stringify(this.photo4) === '{}'" class="cLightGray col-md-3">身份证正面</span>
                            <span class="col-md-6">
                                <!-- (this.photo9.url === null || this.photo9.url ==='' || this.photo9.url === undefined)  ||  -->
                            <rx-upload v-if="photoFlg===0 && JSON.stringify(this.photo4) === '{}'" :data="{id: 11,attrModelid:4}" :init="{class: 1, mime: 1,multi:true}" :elStyle="{width:'80px', height: '58px'}" @success="successUpload">
                                <div class="fl uiImgUpload uiImgUpload-gblock mr10 ">
                                    <a href="javascript:">
                                        <span type="file" value="" class="file"></span>
                                        <em class="bgIcon file-ico"></em>
                                    </a>
                                </div>
                            </rx-upload>
                            <!--  :images="ninePhoto.attrPhoto" -->
                            <rx-viewer v-else class="fl">
                                <div class="clearfix">
                                    <div   class="fl mr10 look_imgHover relative tx-center"  style="width:78px;height:78px;">
                                        <!-- <img :src="ninePhoto.url"> -->
                                         <img :src="photo4.attrPhoto">
                                        <div class="upload_finish_div">
                                        <div class="upload_finish_bg"></div>
                                        <div class="upload_finish_linksm">
                                            <div class="dis-il-block">
                                                <a href="javascript:" class="ImgBtn enlarge_viewer enlarge_link" :data-src="photo4.attrPhoto"></a>
                                                <a href="javascript:" class="ImgBtn delect_link" @click="delImg(photo4.attr_infoid)"></a>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="imgInfo tx-center">身份证正面</div>
                                    </div>
                                </div>
                            </rx-viewer>
                            </span>
                        </p>
                        <p class="col-md-6">
                            <span  v-if="JSON.stringify(this.photo8) === '{}'"  class="cLightGray col-md-3">身份证反面</span>
                                <!-- 反面 -->
                                <span class="col-md-6">
                             <rx-upload v-if="photoFlg==0 && JSON.stringify(this.photo8) === '{}'" :data="{id: 11,attrModelid:8}" :init="{class: 1, mime: 1,multi:true}" :elStyle="{width:'80px', height: '58px'}" @success="successUpload">
                                 <div class="fl uiImgUpload uiImgUpload-gblock mr10 ">
                                     <a href="javascript:">
                                         <span type="file" value="" class="file"></span>
                                         <em class="bgIcon file-ico"></em>
                                     </a>
                                 </div>
                             </rx-upload>
                             <rx-viewer v-else class="fl">
                                <div class="clearfix">
                                    <div  class="fl mr10 look_imgHover relative tx-center"  style="width:78px;height:78px;">
                                        <img :src="photo8.attrPhoto">
                                        <div class="upload_finish_div">
                                        <div class="upload_finish_bg"></div>
                                        <div class="upload_finish_linksm">
                                            <div class="dis-il-block">
                                                <a href="javascript:" class="ImgBtn enlarge_viewer enlarge_link" :data-src="photo8.attrPhoto"></a>
                                                <a href="javascript:"  class="ImgBtn delect_link" @click="delImg(photo8.attr_infoid)"></a>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="imgInfo tx-center">身份证反面</div>
                                    </div>
                                </div>
                            </rx-viewer>
                            </span>
                        </p>
                        <div class="imgbox imgbox1 col-md-3" style="margin-top: 15px;">
                            <img src="https://gnr.rxjy.com/hrms/static/modules/cur/images/edit_img.png" title="编辑" width="20" class="fr pointer mr5" @click="flg1=0">
                        </div>
                    </div>
                    <div class="analyItemCon" v-else>
                            <div class="textBoxtxt hide" style="display: block;">
                                        <p class="col-md-6">
                                            <span class="cLightGray pr8" >身份证号</span>
                                            <input type="text" class="width120 evaluateStandard" name="set_idCardName_education" style="width: 200px;" v-model="idCardStr">
                                        </p>
                                </div>
                            <div class="imgbox imgbox2 " style="margin-top: 15px;">
                                <img src="https://gnr.rxjy.com/hrms/static/modules/cur/images/save_img.png" title="保存" width="20" class="fl pointer mr5" name="update_stage_info_intention" @click="updateIDCard()">
                                <img src="https://gnr.rxjy.com/hrms/static/modules/cur/images/goback_img.png" title="返回" width="20" class="fl pointer mr5" @click="flg1=1">
                            </div>
                    </div>
                </div>
                <div class="analyItem">
                    <p class="analyItemTit tx-center" :class="(this.pemdmert === 0 || this.pemdmert === undefined || this.pemdmert === null || this.pemdmert === '' ||
                            this.cityId === 0 || this.cityId === undefined || this.cityId === null || this.cityId === '' ||
                            this.quName === 0 || this.quName === undefined || this.quName === null || this.quName === '' ||
                            this.AddressDetail === '具体地址信息' || this.AddressDetail === undefined || this.AddressDetail === null || this.AddressDetail === '') ? '' : 'analyLightGreen'">地址</p>
                    <div class="analyItemCon">
                        <span class="cLightGray pr8">现住址</span>
                        <span>
                            <p class="analyItemTit ">
                                <select id="AddressProvinceId" class="width100" v-model="pemdmert" @change="zhuShiQu($event,1)">
                                    <option value="0">请先选择省</option>
                                    <option :value="item.provinceId" v-for="(item,index) in zhuSheng" :key="index">{{item.provinceName}}</option>
                                </select>
                            </p>
                            <p class="analyItemTit  ">
                                <select id="AddressCityId" class="width100" v-model="cityId" @change="zhuQuJu($event,1)">
                                    <option value="0">请先选择市</option>
                                    <option :value="item.cityId" v-for="(item,index) in zhuShi" :key="index">{{item.cityName}}</option>
                                </select>
                            </p>
                            <p class="analyItemTit ">
                                <select id="AddressCountyId" class="width100" v-model="quName" @change="AddressDetail = ''">
                                    <option value="0">请先选择区</option>
                                    <option :value="item.countyId" v-for="(item,index) in zhuQu" :key="index">{{item.countyName}}</option>
                                </select>
                            </p>
                            <p class="analyItemTit">
                                <input type="text" value="具体地址信息" class="width100" v-model="AddressDetail">
                            </p>
                        </span>
                        <div class="imgbox imgbox2 " style="margin-top: 42px;">
                            <img src="https://gnr.rxjy.com/hrms/static/modules/cur/images/save_img.png" title="保存" width="20" class="fl pointer mr5" name="update_stage_info_intention" @click="MappingButton()">
                            <!-- <img src="https://gnr.rxjy.com/hrms/static/modules/cur/images/goback_img.png" title="返回" width="20" class="fl pointer mr5" @click="flg2=1"> -->
                        </div>
                    </div>
                </div>
                <div class="analyItem">
                    <p class="analyItemTit tx-center" :class="((this.stageInfo.family_name === undefined || this.stageInfo.family_name === null || this.stageInfo.family_name === '') ||
                            (this.stageInfo.family_relation === null || this.stageInfo.family_relation ==='' || this.stageInfo.family_relation === undefined) ||
                            (this.stageInfo.family_phone === null || this.stageInfo.family_phone ==='' || this.stageInfo.family_phone === undefined) ||
                            (this.stageInfo.family_wechat === null || this.stageInfo.family_wechat ==='' || this.stageInfo.family_wechat === undefined) ||
                            (this.stageInfo.family_sex === null || this.stageInfo.family_sex ==='' || this.stageInfo.family_sex === undefined)) ? '' : 'analyLightGreen'">家庭关系</p>
                    <div class="analyItemCon" v-if="flg2==1">
                        <p class="col-md-4">
                            <span class="cLightGray pr8">姓名</span>
                            <span name="stage_info_family_name">{{ this.stageInfo.family_name ? this.stageInfo.family_name : '' }}</span>
                        </p>
                        <p class="col-md-4">
                            <span class="cLightGray pr8">关系</span>
                            <span name="stage_info_family_relation">{{ this.stageInfo.family_relation ? this.stageInfo.family_relation : '' }}</span>
                        </p>
                        <p class="col-md-4">
                            <span class="cLightGray pr8">电话</span>
                            <span name="stage_info_family_phone">{{ this.stageInfo.family_phone ? this.stageInfo.family_phone : '' }}</span>
                        </p>
                        <p class="col-md-4">
                            <span class="cLightGray pr8">微信</span>
                            <span name="stage_info_family_wechat">{{ this.stageInfo.family_wechat ? this.stageInfo.family_wechat : '' }}</span>
                        </p>
                        <p class="col-md-4">
                            <span class="cLightGray pr8">性别</span>
                            <span name="stage_info_family_sex">{{this.stageInfo.family_sex === 0 ? '女' : '男'}}</span>
                        </p>
                        <div class="imgbox imgbox1 col-md-3"  style="margin-top: 15px;">
                            <img src="https://gnr.rxjy.com/hrms/static/modules/cur/images/edit_img.png" title="编辑" width="20" class="fr pointer mr5" @click="flg2=0">
                        </div>
                    </div>
                    <div class="analyItemCon" v-else>
                         <div class="textBoxtxt hide" style="display: block;">
                             <p class="col-md-4">
                                 <span class="cLightGray pr8">姓名</span>
                                 <input type="text" class="width120 evaluateStandard" name="set_stage_info_family_name" v-model="familyName">
                             </p>
                             <p class="col-md-4">
                                 <span class="cLightGray pr8">关系</span>
                                 <input type="text" class="width120 evaluateStandard" name="set_stage_info_family_relation" v-model="familyRelation">
                             </p>
                             <p class="col-md-4">
                                 <span class="cLightGray pr8">电话</span>
                                 <input type="text" class="width120 evaluateStandard" name="set_stage_info_family_phone" v-model="familyPhone">
                             </p>
                             <p class="col-md-4" style="padding-top: 10px;">
                                 <span class="cLightGray pr8">微信</span>
                                 <input type="text" class="width80 evaluateStandard" name="set_stage_info_family_wechat" v-model="familyWechat">
                             </p>
                             <p class="col-md-4" style="padding-top: 10px;">
                                 <span class="cLightGray pr8">性别</span>
                                 <!--<input type="text" class="width120 evaluateStandard" name="set_userInfo_sex" value="">-->
                                 <select name="set_stage_info_family_sex" class="width80" v-model="familySex">
                                     <option value="0">女</option>
                                     <option value="1">男</option>
                                 </select>
                             </p>
                         </div>
                        <div class="imgbox imgbox2 " style="margin-top: 42px;">
                            <img src="https://gnr.rxjy.com/hrms/static/modules/cur/images/save_img.png" title="保存" width="20" class="fl pointer mr5" name="update_stage_info_intention" @click="updateStageInfo2()">
                            <img src="https://gnr.rxjy.com/hrms/static/modules/cur/images/goback_img.png" title="返回" width="20" class="fl pointer mr5" @click="flg2=1">
                        </div>
                    </div>
                </div>
            </div>
        <div class="layerRtb-footer">
              <div class="analyItem">
                <p class="analyItemTit tx-center">综合</p>
                <div class="analyItemCon">
                    <p class="fl">
                        <span v-if="((this.stageInfo.age === undefined || this.stageInfo.age === null || this.stageInfo.age === '') ||
                        (this.stageInfo.is_marry === undefined || this.stageInfo.is_marry === null || this.stageInfo.is_marry === '') ||
                        (this.idCardStr === undefined || this.idCardStr === null || this.idCardStr === '') ||
                        JSON.stringify(this.photo4) === '{}' ||
                        JSON.stringify(this.photo8) === '{}' ||
                        (this.pemdmert === 0 || this.pemdmert === undefined || this.pemdmert === null || this.pemdmert === '' ||
                        this.cityId === 0 || this.cityId === undefined || this.cityId === null || this.cityId === '' ||
                        this.quName === 0 || this.quName === undefined || this.quName === null || this.quName === '' ||
                        this.AddressDetail === '具体地址信息' || this.AddressDetail === undefined || this.AddressDetail === null || this.AddressDetail === '') ||
                        (this.stageInfo.family_name === undefined || this.stageInfo.family_name === null || this.stageInfo.family_name === '') ||
                        (this.stageInfo.family_relation === null || this.stageInfo.family_relation ==='' || this.stageInfo.family_relation === undefined) ||
                        (this.stageInfo.family_phone === null || this.stageInfo.family_phone ==='' || this.stageInfo.family_phone === undefined) ||
                        (this.stageInfo.family_wechat === null || this.stageInfo.family_wechat ==='' || this.stageInfo.family_wechat === undefined) ||
                        (this.stageInfo.family_sex === null || this.stageInfo.family_sex ==='' || this.stageInfo.family_sex === undefined))" class="circlemark circlemark-lightRed">待</span>
                        <span v-else class="circlemark circlemark-lightGreen">全</span>
                    </p>
                </div>
            </div>
        </div>
          <transition-group class="animated faster" enter-active-class="animated faster slideInRight" leave-active-class="animated faster slideOutRight">
         </transition-group>
    </div>
</template>
<script>
import { mapGetters, mapMutations } from 'vuex'
import { updateStageInfoByleId, updateUserTypeValueAndAddress, delPhotoByUid, getUserPhotoList, GetProvinceMsg, savePhotoByUid, updateIDCard, findIDCard, getAdressByUid, getCityMsgByProvinceId, getCountyMsgByCityId } from '../../Resources/Api/index'
export default {
    components: {
    },
    data () {
        return {
            familyName: '',
            familyRelation: '',
            familyPhone: '',
            familyWechat: '',
            familySex: '',
            zhuSheng: [], // 现住址的省
            zhuShi: [], // 现住址的市
            zhuQu: [], // 现住址的区
            huixian: {},
            pemdmert: '', // 绑定的现住址的省
            cityId: '', // 绑定的现住址的市
            quName: '', // 绑定的现住址的区
            AddressDetail: '', // 具体地址
            photoFlg: 0,
            photoList: [],
            photo8: {}, // 身份证反面
            photo4: {}, // 身份证正面
            flg2: 1,
            flg1: 1,
            flg: 1,
            stageInfo: {}, // 二段传过来的值
            age: 0, // 年龄
            is_marry: 0, // 是否已婚，0-已婚，1-未婚
            idCardStr: '', // 身份证号
            attrPhoto: '',
            ninePhoto: {}
        }
    },
    created () {
        this.stageInfo = this.$route.query.stageInfo
        this.age = this.stageInfo.age
        this.is_marry = this.stageInfo.is_marry
        this.familyName = this.stageInfo.family_name
        this.familyRelation = this.stageInfo.family_relation
        this.familyPhone = this.stageInfo.family_phone
        this.familyWechat = this.stageInfo.family_wechat
        this.familySex = this.stageInfo.family_sex
        this.findIDCard()
        this.getUserPhotoList()
        // this.getUserListinfoPhoto()
        this.GetProvinceMsg()
        this.getAdressByUid()
    },
    methods: {
        ...mapMutations({
            setUpdatePlate: `SET_UPDATE_PLATE`
        }),
        delImg (value) {
            delPhotoByUid({
                attrInfoId: value
            }).then(result => {
                if (Number(result.data.StatusCode) === 0) {
                    layer.msg('删除成功')
                    // this.getUserPhotoList()
                    // this.setUpdatePlate()
                    this.$router.push(this.$route.matched[1].path)
                }
            }).catch(err => {
                console.log('删除指定照片失败' + err)
            })
        },
        // 认知阶段修改用户的家庭信息
        updateStageInfo2 () {
            if (this.familyName === null || this.familyName === '') {
                layer.msg('请输入家庭姓名')
                return
            }
            if (this.familyRelation === null || this.familyRelation === '') {
                layer.msg('请输入家庭姓名')
                return
            }
            if (this.familyPhone === null || this.familyPhone === '') {
                layer.msg('请输入家庭姓名')
                return
            }
            if (this.familyWechat === null || this.familyWechat === '') {
                layer.msg('请输入家庭姓名')
                return
            }
            updateStageInfoByleId({
                uid: this.leftInfo.uid, // 用户id
                familyName: this.familyName, // 年龄
                familyRelation: this.familyRelation, // 家庭关系，夫妻等
                familyPhone: this.familyPhone, // 手机号
                familyWechat: this.familyWechat, // 微信号
                familySex: this.familySex // 性别，0-女，1-男
            }).then(result => {
                // debugger
                if (Number(result.data.StatusCode) === 0) {
                    layer.msg('修改成功')
                    this.flg2 = 1
                    this.$router.push(this.$route.matched[1].path)
                    // this.setUpdatePlate()
                }
            }).catch(err => {
                console.log('认知阶段修改用户的年龄和婚姻状态失败，异常信息：' + err)
            })
        },
        MappingButton () {
            updateUserTypeValueAndAddress({
                uid: this.leftInfo.uid, // uid
                typeValue: null, // 类型
                AddressCityId: this.cityId, // 市id
                AddressProvinceId: this.pemdmert, // 省
                AddressCountyId: this.quName, // 区
                AddressDetail: this.AddressDetail // 具体地址
            }).then(res => {
                if (res.data.StatusCode === 0) {
                    this.updateStageInfoByleIdFn()
                }
            }).catch(err => {
                console.log('添加指定用户的类型和地址失败updateUserTypeValueAndAddress，异常信息：' + err)
            })
        },
        // 添加指定用户的详细地址信息
        updateStageInfoByleIdFn () {
            updateStageInfoByleId({
                uid: this.leftInfo.uid, // 用户id
                address: this.AddressDetail // 具体地址
            }).then(result => {
                if (result.data.StatusCode === 0) {
                    layer.msg('提交成功')
                    // this.$router.push(this.$route.matched[1].path)
                }
            }).catch(err => {
                console.log('添加指定用户的详细地址信息失败updateStageInfoByleId，异常信息：' + err)
            })
        },
        GetProvinceMsg () {
            GetProvinceMsg({

            }).then(res => {
                this.zhuSheng = res.data.Body
                this.zhuShiQu()
            }).catch(err => {
                console.log(err)
                this.$message('失败')
            })
        },
        getAdressByUid () {
            getAdressByUid({
                uid: this.leftInfo.uid
            }).then(res => {
                this.adress = res.data.Body
                if (res.data.Body[0]) {
                    this.pemdmert = res.data.Body[0].province_id
                    this.cityId = res.data.Body[0].city_id
                    this.quName = res.data.Body[0].county_value
                    this.AddressDetail = res.data.Body[0].now_address
                } else {
                    this.pemdmert = 0
                    this.cityId = 0
                    this.quName = 0
                    this.AddressDetail = '具体地址信息'
                }
                this.zhuShiQu()
                this.zhuQuJu()
            }).catch(err => {
                console.log(err)
                // this.$message('失败')
            })
        },
        zhuShiQu (event, flag) {
            if (flag === 1) {
                this.cityId = ''
                this.quName = ''
                this.AddressDetail = ''
            }

            getCityMsgByProvinceId({
                provinceId: this.pemdmert
            }).then(res => {
                this.zhuShi = res.data.Body
                this.zhuQuJu()
            }).catch(err => {
                console.log(err)
                this.$message('提交失败')
            })
        },
        zhuQuJu (event, flag) {
            if (flag === 1) {
                this.quName = ''
                this.AddressDetail = ''
            }
            getCountyMsgByCityId({
                cityId: this.cityId
            }).then(res => {
                this.zhuQu = res.data.Body
            }).catch(err => {
                console.log(err)
                this.$message('提交失败')
            })
        },
        // 照片上传
        successUpload (value) {
            savePhotoByUid({
                uid: this.leftInfo.uid, // this.leftInfo.uid,
                attrModelid: value.data.attrModelid,
                userType: 1,
                attrServerUrl: '',
                attrFileUrl: value.src
            }).then(res => {
                if (res.data.StatusCode === 0) {
                    this.$message('上传成功')
                    this.getUserPhotoList() // 银行卡回显
                    // if (value.data.attrModelid === 17) {
                    this.setUpdatePlate()
                    // }
                }
            }).catch(err => {
                console.log(err)
            })
        },
        // 照片回显
        // getUserListinfoPhoto () {
        //     getUserListinfoPhoto({
        //         uid: this.leftInfo.uid // this.leftInfo.uid,
        //     }).then(res => {
        //         if (res.data.StatusCode === 0) {
        //             this.photoList = res.data.Body
        //         }
        //         console.log(res.data.Body)
        //     }).catch(err => {
        //         console.log('银行卡回显getUserListinfoPhoto失败，失败原因为' + err)
        //     })
        // },
        // 照片回显
        getUserPhotoList () {
            // let _this = this
            // _this.photo9 = {}
            getUserPhotoList({
                uid: this.leftInfo.uid // this.leftInfo.uid,
            }).then(res => {
                if (res.data.StatusCode === 0) {
                    this.photoList = res.data.Body
                    if (this.photoList.length > 0) {
                        this.photoList.forEach(photo => {
                            if (Number(photo.attr_modelid) === 8) {
                                this.photo8 = photo
                            }
                            if (Number(photo.attr_modelid) === 4) {
                                this.photo4 = photo
                            }
                        })
                    }
                }
            }).catch(err => {
                console.log('银行卡回显getUserListinfoPhoto失败，失败原因为' + err)
            })
        },
        // findPhotoByUid () {
        //     findPhotoByUid({
        //         uid: this.leftInfo.uid,
        //         attrModelid: 9
        //     }).then(result => {
        //         if (Number(result.data.StatusCode) === 0) {
        //             this.ninePhoto = result.data.Body[0]
        //         }
        //     }).catch(err => {
        //         console.log('查询用户身份证正面的照片失败，' + err)
        //     })
        // },
        // 查询身份证号
        findIDCard () {
            findIDCard({
                uid: this.leftInfo.uid // 用户id
            }).then(result => {
                if (Number(result.data.StatusCode) === 0) {
                    this.idCardStr = result.data.Body.idcard
                }
            }).catch(err => {
                console.log('查询用户身份证号失败，异常信息：' + err)
            })
        },
        // 更新身份证号
        updateIDCard () {
            updateIDCard({
                uid: this.leftInfo.uid, // 用户id
                IDCard: this.idCardStr // 省份证号
            }).then(result => {
                if (Number(result.data.StatusCode) === 0) {
                    layer.msg('修改成功')
                    this.flg1 = 1
                    this.setUpdatePlate()
                    // this.$router.push(this.$route.matched[1].path)
                }
            }).catch(err => {
                console.log('修改身份证号失败updateIDCard，异常信息：' + err)
            })
        },
        // 认知阶段修改用户的年龄和婚姻状态
        updateStageInfo1 () {
            if (this.age === null || this.age === '') {
                layer.msg('请输入年龄')
                return
            }
            updateStageInfoByleId({
                uid: this.leftInfo.uid, // 用户id
                age: this.age, // 年龄
                isMarry: this.is_marry // 是否结婚，0-是，1-否
            }).then(result => {
                if (Number(result.data.StatusCode) === 0) {
                    layer.msg('修改成功')
                    this.flg = 1
                    // this.setUpdatePlate()
                    // this.$router.push(this.$route.matched[1].path)
                }
            }).catch(err => {
                console.log('认知阶段修改用户的年龄和婚姻状态失败，异常信息：' + err)
            })
        }
    },
    computed: {
        ...mapGetters(['leftInfo'])
    },
    watch: {
    }
}

</script>
<style  scoped>
    .imgbox {
    position: absolute;
    right: 10px;
    top: 10px;
}
</style>
